package cn.qzzg.springcloud.user.controller;

import cn.qzzg.springcloud.user.service.inter.UserServiceInter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    UserServiceInter userServiceInter;

    /**
     * 远程获取用户名称1
     * @return
     */
    @GetMapping("/getUserName")
    public String getUserName(){
        return userServiceInter.getUserName();
    }

    /**
     * 远程获取用户名称(获取失败触发熔断机制)
     * @return
     */
    @GetMapping("/getUserNameFail")
    public String getUserNameFail(){
        return userServiceInter.getUserNameFail();
    }

    /**
     * 远程获取用户名称
     * @return
     */
    @GetMapping("/getRemoteUserName")
    public String getRemoteUserName(){
        return userServiceInter.getRemoteUserName();
    }

    /**
     * 远程获取用户名称通过负载均衡
     * @return
     */
    @GetMapping("/getgetRemoteUserNameBalance")
    public String getgetRemoteUserNameBalance(){
        return userServiceInter.getgetRemoteUserNameBalance();
    }
}
